\label{section::implementation}
\section{Extended Backus-Naur Formalism} \label{EBNF}
	
	This chapter defines the syntax of our programming language expressed in EBNF.
	Terminal symbols are boldfaced.
	A symbol followed by an asterisk (ex. Symbol*) denotes that the symbol occurs zero or more times.
	A symbol followed by a plus (ex. Symbol$^+$) denotes that the symbol occurs one or more times.
	Letter is any single letter from a-z, lowercase or uppercase, and Digit is a single numeric literal, 0-9.
	
	\vspace{2mm}
	\begin{longtable}{|rl|}
		\hline 
		CLUBsFile $::=$ & LibReference* ( LibDef $|$ GameDef ) \\
		LibReference $::=$ & \textbf{using} Identifier \textbf{;} \\
		LibDef $::=$ & \textbf{library \{} Definition* \textbf{\}} \\
		GameDef $::=$ & \textbf{game \{} Definition* StartAction Definition* \textbf{\}} \\
		& \\
		Definition $::=$ & ObjectDef $|$ ActionDef \\
		ObjectDef $::=$ & Type Identifier \textbf{\{} Statement* \textbf{\}} \\
		ActionDef $::=$ & \textbf{action} Identifier
			( $\varepsilon |$ \textbf{gives} ObjectType ) \\
		&	( $\varepsilon |$ \textbf{takes} ( ObjectType Identifier )$^+$ ) \\
		&	\textbf{\{} Statement* \textbf{\}}  \\
		StartAction $::=$ & \textbf{start} \textbf{\{} Statement* \textbf{\}} \\
		& \\
		Statement $::=$ & CtrlStruct $|$ ( ( AssignStmt $|$ CallStmt $|$ DeclStmt ) \textbf{;} ) \\
		AssignStmt $::=$ & ( CompIdent $|$ DeclStmt ) \textbf{=} Expression \\
		DeclStmt $::=$ & ObjectType Identifier \\
		CallStmt $::=$ & Identifier \textbf{(} ($\varepsilon |$ Expression (\textbf{,} Expression)*) \textbf{)} \\
		& \\
		CtrlStruct $::=$ & If $|$ Check $|$ While $|$ For \\
		If $::=$ & \textbf{if (} Expression \textbf{) \{} Statement* \textbf{\}} \\
		Check $::=$ & \textbf{check (} Expression \textbf{) \{} Case* \textbf{\}} \\
		Case $::=$ & \textbf{case} Expression \textbf{:} Statement* \\
		While $::=$ & \textbf{while (} Expression \textbf{) \{} Statement* \textbf{\}} \\
		For $::=$ & \textbf{for (} Statement \textbf{;} Expression \textbf{;} Statement \textbf{)} \\
		& \textbf{\{} Statement* \textbf{\}} \\
		& \\
		Expression $::=$ & SubExpression (Operator SubExpression)* \\
		SubExpression $::=$ & CallStmt $|$ \textbf{"} ANY* \textbf{"} $|$ IntLiteral \\
		& $|$ CompIdent $|$ Operator SubExpression \\
		& $|$ \textbf{(} Expression \textbf{)} \\
		& \\
		ObjectType $::=$ & \textbf{board} $|$ \textbf{cell} $|$ \textbf{piece} $|$ \textbf{player} $|$ \textbf{round} $|$ \textbf{turn} \\
		IdentType $::=$ & \textbf{board} $|$ \textbf{cell} $|$ \textbf{piece} $|$ \textbf{player} $|$ \textbf{round} $|$ \textbf{turn} \\
		& $|$ \textbf{action} $|$ \textbf{int} $|$ \textbf{string} $|$ \textbf{bool} \\
		CompIdent $::=$ & ArrayIdent ( \textbf{-\textgreater} ArrayIdent )* \\
		ArrayIdent $::=$ & Identifier ( \textbf{[} IntLiteral \textbf{]} )* \\
		Identifier $::=$ & Letter (Letter $|$ Digit)* \\
		& \\
		Operator $::=$ & \textbf{+} $|$ \textbf{-} $|$ \textbf{*} $|$ \textbf{/} $|$ \textbf{is} $|$ \textbf{not} \\
		IntLiteral $::=$ & Digit Digit* \\
		& \\
		Comment $::=$ & \textbf{//} Graphic* eol \\
		\hline
	\end{longtable}
	\vspace{2mm}
	
	The symbol \textit{ANY} describes any character that does not match any of the tokens delimiting the use of ANY. In this case, the token \textbf{"} defines both the start and end of the sequence, making \textit{ANY} describe all characters that are not \textbf{"}.
	\textit{Graphic} describes any visible character or whitespace, except linebreaks (eol\footnote{End of line}).